<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="__HOME__/css/weui.css">
    <link rel="stylesheet" href="__HOME__/css/jquery-weui.css">
    <link rel="stylesheet" href="__HOME__/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_689900_q7w1lloaqzg2e29.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_587767_cs9ofcebz4w.css">

    <style>
        .mycenter-top{background: #fff;overflow: hidden;line-height: 60px;padding:20px;}
        .mycenter-top img{border-radius: 50%;float: left;}
        .mycenter-top p{margin-left: 20px;float: left;font-size: 18px;}
        .user-list-lb .iconfont {margin-right: 10px;}
        .user-list-lb .icon.i1 {color: #8ac961;padding-right: 10px}
        /*4abdcc*/
        .user-list-lb .iconfont.i2 {color: #1296db;}
        .user-list-lb .iconfont.i3 {color: #e76160;}
    </style>
</head>
<body class="back1">




<div class="mycenter-top" style="position: relative">
    <a  href="{:url('edit')}?shop_id={$shop_id}" style="position: absolute;right: 20px;top: -10px;font-size: 15px;color: #737373">编辑</a>

    {if $res.headimgurl == null}
    <img src="__HOME__/images/photo.jpg" width="60"  height="60">
    {else}
    <img src="{$res.headimgurl}" width="60" height="60">
    {/if}
    {if $res.realname == null}
     <p>{$res.wx_name}</p>
    {else}
     <p>{$res.realname}</p>
    {/if}
</div>
<div class="weui-cells user-list-lb">
    <a class="weui-cell weui-cell_access" href="javascript:weixin_qr()" >
        <div class="weui-cell__hd"><i class="icon icon-saoyisao  i1"></i></div>
        <div class="weui-cell__bd">
            <p>绑定学生</p>
        </div>
        <div class="weui-cell__ft"></div>
    </a>
    <a class="weui-cell weui-cell_access"  href="{:url('store/parent.sign/detail')}?shop_id={$shop_id}">
        <div class="weui-cell__hd"><i class="iconfont icon-huifu i2"></i></div>
        <div class="weui-cell__bd">
            <p>签到详情</p>
        </div>
        <div class="weui-cell__ft"></div>
    </a>
    <!--<a class="weui-cell weui-cell_access" href="transaction.html">-->
        <!--<div class="weui-cell__hd"><i class="iconfont icon-jiaoyi i3"></i></div>-->
        <!--<div class="weui-cell__bd">-->
            <!--<p>交易记录</p>-->
        <!--</div>-->
        <!--<div class="weui-cell__ft"></div>-->
    <!--</a>-->
    <!--<a class="weui-cell weui-cell_access" href="javascript:;">-->
        <!--<div class="weui-cell__hd"><i class="iconfont icon-add-copy i2"></i></div>-->
        <!--<div class="weui-cell__bd">-->
            <!--<p>添加股票</p>-->
        <!--</div>-->
        <!--<div class="weui-cell__ft"></div>-->
    <!--</a>-->
    <!--<a class="weui-cell weui-cell_access" href="javascript:;">-->
        <!--<div class="weui-cell__hd"><i class="iconfont icon-jiaoyi i3"></i></div>-->
        <!--<div class="weui-cell__bd">-->
            <!--<p>查看交易</p>-->
        <!--</div>-->
        <!--<div class="weui-cell__ft"></div>-->
    <!--</a>-->
</div>
<div class="mb70"></div>
<div class="weui-flex weui-fixed-btm">
    <div class="weui-flex__item">
        <a href="index.html" class="weui-fixed-btn">
            <i class="iconfont icon-shouye"></i>
            <p>首页</p>
        </a>
    </div>
    <div class="weui-flex__item">
        <a href="javascript:;" class="weui-fixed-btn weui-btn_primary">
            <i class="iconfont icon-yonghufill"></i>
            <p>用户中心</p>
        </a>
    </div>
</div>

</body>

<script src="__HOME__/js/jweixin-1.2.0.js"></script>
<script src="__HOME__/js/jquery.min.js"></script>
<script src="__HOME__/js/jquery-weui.min.js"></script>
<script>

    wx.config({
        debug: false,
        appId: '{$jsconfig.appId}',
        timestamp: '{$jsconfig.timestamp}',
        nonceStr: '{$jsconfig.noncestr}',
        signature: '{$jsconfig.signature}',
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
        ]
    });
    wx.isInit = false;

    /**
     *  学生绑定
     */
    function weixin_qr() {
        wx.scanQRCode({
            desc: 'scanQRCode desc',
            needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
            success: function (res) {
                var data = JSON.stringify(res);
                if(res.errMsg === 'scanQRCode:ok'){
//                    window.location.href="{:url('store/parent.index/student_bind')}?data="+data;
                    $.post("{:url('/store/parent.index/student_bind')}?shop_id={$shop_id}",{data:data},function (res) {
                        if(res.code==1){
                            $.toast(res.msg, function () {
                                   location.href = "{:url('mycenter')}?shop_id={$shop_id}";
                               });
                        }
                        else {
                               $.toast(res.msg ,function () {
                                   location.href = "{:url('mycenter')}?shop_id={$shop_id}";
                               })
                            }
                    });
                }else{
                    alert("二维码信息有误");
                }

            }
        });
    }

</script>
</html>

